<script type="text/javascript">
    $(function(){
        trbgmoves('#d3dff2');
    })
    function shitss(id){
        var sid= $("#sid"+id).val();
        window.open('http://www.aliexpress.com/snapshot/'+sid+'.html');
    }
    function tuisong(id){

        var id=id.substring(2);
        $.ajax({
            type:'post',
            data:'orderid='+id,
            timeout:15000,
            url:"<?=blang_url('ajax/ajax/tuisongorder/')?>",
            beforeSend: function () {
                $("#sp"+id).html("<img src='/resource/images/ajax-loader.gif'>");
            },
            success: function (msg) {
                if(msg.length==10) {
                    alert("<?=lang('smttscg')?>！");
                    $("#sp"+id).html("<a href='"+"<?=blang_url('orders/order/inDetails')?>/"+msg+"'><?=lang('smtckdd')?></a>");
                }else{
                    alert("<?=lang('smttssb')?>！！！"+msg);
                    $("#sp"+id).html("<a href='javascript:void(0)' id='ts"+id+"' onclick='tuisong(id)'><?=lang('smttsdd')?></a>");
                }
            },
            error: function (e, jqxhr, settings, exception) {
                $("#sp"+id).text("<?=lang('smtqqcw')?>...");
            }
        });
    }
</script>
<!--top结束-->
<div class="mian">
    <div class="mian1">
        <div class="mian2">
            <!--left start-->
            <?php $this->load->view('defaults/common/left');?>
            <!--left end-->

            <!--right start-->
            <div class="right">
                <!--breadcrumb start-->
                <div class="righta"><?=$this->breadcrumb->generateHTML();?> </div>
                <!--breadcrumb end-->

                <!-- contents start -->
                <div id="contents">
                    <div id="ct_search">
                        <form action="<?=blang_url('orders/AliExpress/GetAliExpressWarrantyList')?>" method="post" name="searchform" >
                            <table id="search_tb">
                                <tr>
                                    <td >
                                        <input name="orderId" value="" placeholder="<?=lang('smtddh')?>" />&nbsp;&nbsp;
                                        <?=lang('smtgj')?>：<select name="country">
                                            <option value=""><?=lang('smtqxzgj')?></option>
                                            <?php foreach($countryList as $row):?>
                                                <option value="<?=$row['site_prefix']?>"><?=$row['site_prefix']?></option>
                                            <?php endforeach;?>
                                        </select>
                                        <input type="submit" name="searchSubmit" value="<?=lang('smtcx')?> " />&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </form>
                        <!--<form action="<?/*=blang_url('orders/Smtexcel/upload/time')*/?>" method="post" enctype="multipart/form-data" name="excelform" >
                            <table id="search_tb">
                                <tr>
                                    <td >
                                        <input name="action" type="hidden" value="submit" />
                                        <input type="file" name="fileField" id="fileField2" />
                                        <input type="submit" name="button" id="button" value="<?/*=lang('smtwbsjzr')*/?>" onclick="return tijiao()"/>&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </form>-->
                    </div>
                    <div class="ct_content">
                            <table>
                                <tr>
                                    <th width="10%"><?=lang('smtddh')?></th>
                                    <th width="40%"><?=lang('smtspm')?></th>
                                    <th width="10%"><?=lang('smtddsj')?></th>
                                    <th width="5%"><?=lang('smtddje')?></th>
                                    <th width="5%"><?=lang('smtwbjg')?></th>
                                    <th width="10%"><?=lang('smtwbkssj')?></th>
                                    <th width="10%"><?=lang('smtwbjssj')?></th>
                                    <th width="5%"><?=lang('smtgj')?></th>
                                    <th width="5%"><?=lang('smtcz')?></th>
                                </tr>
                                <?php foreach($orderList as $key=>$v):?>
                                    <tr class="moves"   id="<?=$v['orderId']?>" ondblclick="shitss(id)">
                                        <td align="center"><?=$v['orderId']?><input type="hidden" id="sid<?=$v['orderId']?>" name="sid" value="<?=$v['snapshotId']?>"></td>
                                        <td><?=$v['productName']?></td>
                                        <td align="center"><?=$v['orderDate']?></td>
                                        <td align="center"><?=$v['productAmount']/100?></td>
                                        <td align="center"><?=$v['serviceAmount']/100?></td>
                                        <td align="center"><?=$v['serviceStartTime']?></td>
                                        <td align="center"><?=$v['serviceEndTime']?></td>
                                        <td align="center"><?=$v['country']?></td>
                                        <td align="center">
                                            <a href="<?=blang_url('orders/AliExpress/ViewAliExpressOrderInfo/'.$v['orderId'])?>"><?=lang('smtckxq')?></a>
                                            <!--<span id="sp<?/*=$v['parent_order_id']*/?>">
                                                <?php /*if($v['mtorderid']){*/?>
                                                    <a href="<?/*=blang_url('orders/order/inDetails/'.$v['mtorderid'])*/?>"><?/*=lang('smtckdd')*/?></a>
                                                <?php /*}else{ */?>
                                                    <a href="javascript:void(0)" id="ts<?/*=$v['parent_order_id']*/?>" onclick="tuisong(id)"><?/*=lang('smttsdd')*/?></a>
                                                <?php /*}*/?>
                                            </span>-->
                                            <!--<a href="<?=blang_url('orders/Smtexcel/deletesc2/'.$v['parent_order_id'])?>" onclick="return confirm('delete？')">删除</a>-->
                                        </td>
                                    </tr>
                                <?php endforeach; ?>
                                <?php if($AliExpressApiInfo){ ?>
                                    <tr>
                                        <td colspan="8" align="center"><h3><span style="color: blue">以下是数买通接口查询信息</span></h3></td>
                                    </tr>
                                    <?php foreach($AliExpressApiInfo as $key=>$var):?>
                                    <tr class="moves">
                                        <td><?=$key?></td>
                                        <td colspan="7"><?=$var?></td>
                                    </tr>
                                <?php endforeach;}?>
                                <tr><td colspan="9" align="center"><?=$pageshow?></td></tr>
                            </table>
                    </div>
                </div>
                <!-- contents end -->
            </div>
            <!--right end-->
            <div class="clear"></div>
        </div>
    </div>
</div>

